package com;

import java.util.Date;

import com.ecbt.rest.util.DateUtil;

public class TestDate {

	public static void main(String[] args) {
		
		System.out.println(TestDate.validateCouldDelete("2021-01-19 20:55:14"));
	}
	
	public static boolean validateCouldDelete(String inputtime) {
		
		String reqDate = "210818";
		System.out.println(reqDate.substring(2,4) + "/" + reqDate.substring(4,6) + "/" + reqDate.substring(0,2));
		
		
		Date d = new Date(1622617742L);
		System.out.println(d);
		
		Integer srt = null;
		System.out.println(srt + "");
		
		/// 判定当前时间在8:30分之前还是之后
		String currTime = DateUtil.getSystemDate();
		// 跟今天的 8:30 比较
		String todayDate = DateUtil.date2Str(new Date(), "yyyyMMdd");
		String today830 = currTime.substring(0, 10).concat(" 08:30:00");
		String next830 = "";
		if(currTime.compareTo(today830) > 0) {
			next830 = DateUtil.addDateByDay(todayDate, 1);
			next830 = DateUtil.fromatStrDate(next830);
			next830 = next830.concat(" 08:29:59");
		}else {
			next830 = currTime.substring(0, 10).concat(" 08:29:59");;
			today830 = DateUtil.addDateByDay(todayDate, -1);
			today830 = DateUtil.fromatStrDate(today830);
			today830 = today830.concat(" 08:30:00");
		}
		if(inputtime.compareTo(today830) >= 0 && inputtime.compareTo(next830) <= 0) {
			return true;
		}
		return false;
	}
	
}
